﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EHTWebsite.Code;

namespace EHTWebsiteProject
{
    public partial class NewsDetails : System.Web.UI.Page
    {
        int TinTucID = -1;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    TinTucID = Int32.Parse(Request.QueryString["TinTucID"].ToString());
                    LoadData();
                }
                catch
                {
                    Response.Redirect("Hjem.html");
                }
            }
        }

        private void LoadData()
        {
            TinTuc theTinTuc=TinTucProvider.GetTinTucByTinTucID(TinTucID);
            ltrTittleNews.Text = theTinTuc.TieuDeVN;
            ltrContentNews.Text = theTinTuc.NoiDungVN;
        }
    }
}